package app.mvc.view.layers
{
	import alternativa.gui.alternativagui;
	import alternativa.gui.base.GUIobject;
	import alternativa.gui.container.Container;
	import alternativa.gui.container.gridContainer.GridContainer;
	import alternativa.gui.container.linear.AutoLODVBox;
	import alternativa.gui.container.linear.LODVBox;
	import alternativa.gui.container.linear.RelativeVBox;
	import alternativa.gui.container.linear.VBox;
	import alternativa.gui.container.linear.VBoxExpand;
	import alternativa.gui.data.DataProvider;
	import alternativa.gui.layout.IStageSizeListener;
	import alternativa.gui.layout.LayoutManager;
	import alternativa.gui.theme.defaulttheme.container.panel.Panel;
	import alternativa.gui.theme.defaulttheme.controls.dropDownMenu.DropDownMenu;
	import alternativa.gui.theme.defaulttheme.controls.text.Label;
	
	import app.mvc.view.components.panels.ControlsBar;
	import app.mvc.view.components.panels.LabelsBar;
	import app.mvc.view.components.panels.PropertiesBar;
	
	import globals.Config;
	import globals.Global;
	
	import utils.Tracker;
	
	use namespace alternativagui;
	
	/**
	 * 操作层(初始包括上方标签栏,左侧工具栏,中侧UI操作区,右侧属性编辑区域)
	 * @author XiLing
	 */
	public class OperationsLayer extends Container implements IStageSizeListener
	{
		/**
		 * 中间层容器
		 * @default 
		 */
		private var bodyContainer:Container;
		/**
		 * 标签栏
		 * @default 
		 */
		public var labelsBar:LabelsBar;
		
		/**
		 * 左边控件条
		 * @default 
		 */
		public var controlsBar:ControlsBar;
		
		/**
		 * 属性窗体
		 * @default 
		 */
		public var propertiesBar:PropertiesBar;
		
		private var mainVBox:LODVBox;
		
		public function OperationsLayer()
		{
			super();
			init();
		}
		
		private function init():void
		{
			mainVBox = new LODVBox(Config.MAIN_VBOX_SPACES);
			addChild(mainVBox);
			
			labelsBar = new LabelsBar();
			mainVBox.addChild(labelsBar);
			
			
			bodyContainer = new Container();
			mainVBox.addChild(bodyContainer);
			
			// create a left panel
			controlsBar = new ControlsBar();
			bodyContainer.addChild(controlsBar);
			
			propertiesBar = new PropertiesBar();
			bodyContainer.addChild(propertiesBar);
			propertiesBar.x = Global.stageW - propertiesBar.width;
						
		}
		
		override protected function draw():void {
			super.draw();
			
			if (labelsBar != null) {
				labelsBar.resize(_width,20);
			}
			bodyContainer.resize(_width,_height);
			mainVBox.resize(_width,_height);
		}
		
		override public function drawChildren():void
		{
			// TODO Auto Generated method stub
			super.drawChildren();
		}
		
		override public function drawGraphics():void
		{
			// TODO Auto Generated method stub
			super.drawGraphics();
		}
		
	}
} 	